package com.eedi.framework.user.controller.org.vo;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.eedi.framework.user.excel.RowNoHolder;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.ToString;
import org.hibernate.validator.constraints.Length;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * @Project eedi-org
 * @Description 用户账号批量添加
 * @Author TomBombadil
 * @Date 2024/08/05 14:07
 **/
@ExcelIgnoreUnannotated
@ToString
@Schema(description = "经营管理 - 批量添加成员 Request VO")
public class OrgUserAccountImportReq implements RowNoHolder,Serializable {

    /**
     * excel行号
     */
    private int rowNo;

    /**
     * 用户登录名
     */
    @NotNull(message = "用户账号不能为空")
    @Length(min = 4, max = 20)
    @ExcelProperty(value = "用户账号", index = 0)
    private String orgUserLoginId;

    /**
     * 昵称
     */
    @NotNull(message = "用户姓名不能为空")
    @Length(min = 2,max = 20)
    @ExcelProperty(value = "用户姓名", index = 1)
    private String orgUserName;

    /**
     * 手机
     */
    @NotNull(message = "用户手机号不能为空")
    @Length(min = 11, max = 11)
    @ExcelProperty(value = "手机号码", index = 2)
    private String orgUserMobile;

    /**
     * 加密后的密码
     * 因为目前使用 {@link BCryptPasswordEncoder} 加密器，所以无需自己处理 salt 盐
     */
    @Schema(description = "用户密码", example = "zhangSan_123")
    private String orgUserPassword;

    @ExcelProperty(value = "身份证号码", index = 3)
    private String orgUserCertNo;

    public OrgUserAccountImportReq() {
    }

    public int getRowNo() {
        return this.rowNo;
    }

    public String getOrgUserLoginId() {
        return this.orgUserLoginId;
    }

    public String getOrgUserName() {
        return this.orgUserName;
    }

    public String getOrgUserMobile() {
        return this.orgUserMobile;
    }

    public String getOrgUserCertNo() {
        return this.orgUserCertNo;
    }
    @Override
    public void setRowNo(int rowNo) {
        this.rowNo = rowNo;
    }

    public void setOrgUserLoginId(String orgUserLoginId) {
        this.orgUserLoginId = orgUserLoginId;
    }

    public void setOrgUserName(String orgUserName) {
        this.orgUserName = orgUserName;
    }

    public void setOrgUserMobile(String orgUserMobile) {
        this.orgUserMobile = orgUserMobile;
    }

    public void setOrgUserCertNo(String orgUserCertNo) {
        this.orgUserCertNo = orgUserCertNo;
    }

    public void setOrgUserPassword(String orgUserPassword){
        this.orgUserPassword = orgUserPassword;
    }
    public String getOrgUserPassword(){
        return this.orgUserPassword;
    }
}
